import 'package:flutter/material.dart';
import 'package:zchope_student/const.dart';
class FuJinFragment extends StatefulWidget {
  @override
  _FuJinFragmentState createState() => _FuJinFragmentState();
}

class _FuJinFragmentState extends State<FuJinFragment> {

  List<Widget> _childList(){
    List<Widget> list=new List();
    for(int i=0;i<4;i++){
      list.add( buildListItem(),);
    }
    return list;
  }

  Widget buildListItem() {
    return Column(
      children: <Widget>[
        SizedBox(height: 12,),
        Stack(
          alignment: Alignment.topLeft,
          children: <Widget>[
            Stack(
              alignment: Alignment.bottomCenter,
              children: <Widget>[
                Container(
                  height: 260,
                  decoration: new BoxDecoration(
                    borderRadius: new BorderRadius.all(new Radius.circular(8.0)),
                    image: new DecorationImage(
                      image: new AssetImage('images/items2.png',),
                      centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),
                    ),
                  ),
                ),
                Opacity(
                  opacity: 0.5,
                  child: Container(
                    height: 73,
                    color: Colors.black,
                  ),
                ),
                Padding(
                  padding: EdgeInsets.only(left: 13,right: 13,bottom: 16),
                  child: Row(
                    mainAxisAlignment:MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: <Widget>[
                          Text('一所开在深山里的驾校',style: TextStyle(fontSize: 18,color: Colors.white),),
                          SizedBox(height: 7,),
                          Text('School FOREEST',style: TextStyle(fontSize: 13,color: Colors.white),)
                        ],
                      ),
                      Text('￥1200',style: TextStyle(fontSize: 18,color: Const.gold),)
                    ],
                  ),
                )
              ],
            ),
            Padding(
              padding: EdgeInsets.only(top: 17,left: 13),
              child: Container(
                decoration: new BoxDecoration(
                  color: Colors.black45,
                  borderRadius: new BorderRadius.all(new Radius.circular(8.0)),
                ),
                child: Padding(
                  padding: EdgeInsets.fromLTRB(7, 4, 7, 4),
                  child: Text('<900m',style: TextStyle(fontSize: 12,color: Colors.white),),
                ),
              ),
            )
          ],
        )
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: _childList(),
    );
  }
}
